package org.example.musicserver.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.example.musicserver.common.Result;
import org.example.musicserver.entity.Rate;
import org.example.musicserver.service.RateService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rate")
@Tag(name = "评分相关接口")
public class RateController {

    @Resource
    private RateService rateService;

    @PostMapping("/addOrUpdate")
    @Operation(summary = "添加修改评分")
    public Result addOrUpdateRate(@RequestBody Rate rate) {
        return rateService.addOrUpdateRate(rate);
    }

    @PostMapping("/detail")
    @Operation(summary = "查询评分")
    public Result detail(@RequestBody Rate rate){
        return rateService.detail(rate);
    }
}
